<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title></title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <!-- 这个脚本依赖于Vue，所以要放在Vue的后面 -->
    <script src="https://cdn.jsdelivr.net/npm/vue-resource@1.5.1"></script>
</head>

<body>
    <div id='app'>
        <ul>
            <li v-for="item in list">
                <img :src="item.imgUrl" alt="">
            </li>
        </ul>

    </div>
    <script>
        // 全局配置
        // Vue.http.options.emulateJSON = true;

        const vm = new Vue({
            el: '#app',
            data: {
                list: null
            },
            created() {
                // 调用接口
                // 这里vue-resource是通过promise解决的异步问题
                // get方法会返回一个Promsie对象
                let body = {
                    dictType: 'blogroll',
                    pageNum: 1,
                    pageSize: 5,
                    orderByColumn: 'createTime',
                    isAsc: 'desc'
                }
                let options = {
                    emulateJSON: true,
                    headers: {
                        token: "123456"
                    }
                }
                this.$http.post('http://59.111.104.104:8086/system/dict/data/list/open', body, options).then(({
                    body
                }) => {
                    // 判断接口是否成功
                    debugger
                })



            },
        })
    </script>
</body>

</html>